Skip to content

feat(elixir_app): add name, target_compatible_with, testonly and tags - #3

Open
TrapsterDK wants to merge 1 commit into
bazelverse:mainfrom
TrapsterDK:pr1
Open

TrapsterDK wants to merge 1 commit into
bazelverse:mainfrom
TrapsterDK:pr1

Conversation

@TrapsterDK

Copy link
Copy Markdown

Problem
elixir_app always creates the targets beam_files, app_file, ebin, elixir_without_app_overlap and erlang_app, with the output dirs beam_files, ebin and unconsolidated. Two apps cannot share a package, and the generated targets cannot be marked incompatible, testonly or tagged.

Change

  • New argument name, default "erlang_app". With the default, every target name and output dir stays exactly as it is today.
  • With any other name, the internal targets are <name>_beam_files, <name>_app_file, <name>_ebin and <name>_elixir_without_app_overlap, and the output dirs are <name>/beam_files, <name>/ebin and <name>/unconsolidated.
  • New arguments target_compatible_with, testonly and tags, passed to all five generated targets.

Test
In test/:

  • app_targets_test (build_test) builds :erlang_app, :beam_files, :app_file, :ebin, :elixir_without_app_overlap and the five targets of a second app named other.
  • app_names_test checks the output dirs: beam_files, ebin, unconsolidated for the default app (no prefix), and other/beam_files, other/ebin, other/unconsolidated.
  • other is testonly. If testonly were not passed to every target, its final target would fail analysis.
  • incompatible_app has target_compatible_with = ["@platforms//:incompatible"]. //... skips it, and a new CI step checks that bazelisk build //:incompatible_app fails.
  • test/MODULE.bazel gains bazel_skylib and platforms.

On main the package does not load, because elixir_app has no name argument.

Test output (OTP 29.0, Elixir 1.20.3, Bazel 9.2.0, --nohome_rc)

bazel test //... in test/: Executed 2 out of 6 tests: 6 tests pass. The CI negative checks (failing_test, broken_test, empty_test) fail as expected. //:incompatible_app fails to build as expected. The OTP 28.5 / Elixir 1.19.5 pair was not run as a whole.

Assisted by Claude.

elixir_app always creates the targets beam_files, app_file, ebin,
elixir_without_app_overlap and erlang_app, with the output dirs
beam_files, ebin and unconsolidated. Two apps cannot share a package,
and the generated targets cannot be marked incompatible, testonly or
tagged.

Add a name argument, default "erlang_app". With the default, every
target name and output dir stays as it is today. With any other name,
the internal targets are named <name>_beam_files, <name>_app_file,
<name>_ebin and <name>_elixir_without_app_overlap, and their output
dirs are <name>/beam_files, <name>/ebin and <name>/unconsolidated.

Add target_compatible_with, testonly and tags, and pass them to all
five generated targets.

Tests in test/: a build_test and a path check for the default names
and output dirs, a second app named "other" (testonly) in the same
package, and an app with target_compatible_with incompatible that
//... skips and that fails when built directly (checked in CI).
TrapsterDK added a commit to devhusdk/rules_dx that referenced this pull request Nov 4, 2026
…rt of #3744) (#6702)

The patch now matches the four upstream PRs, so each merge is a pin bump
plus deleting one patch file: elixir_app_name (bazelverse/rules_elixir#3),
elixir_app_deps (#2), warnings_as_errors (#4) and relocatable_tree (waits
on rules_erlang#18). Applied in that order; concatenated they equal the
old patch.


Claude-Session: https://claude.ai/code/session_011u9TXHDZrfmzFQ2WT8QAKK

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant